<template>
  <section style="margin-bottom: 32px; border: 1px solid #eee; padding: 16px;">
    <h2>计数器</h2>
    <button @click="countStore.decrement">-</button>
    <span style="margin: 0 16px;">{{ countStore.count }}</span>
    <button @click="countStore.increment">+</button>
  </section>
</template>

<script setup>
import { useCountStore } from "../store/count";
const countStore = useCountStore()
</script>

<style scoped>
button {
  padding: 4px 12px;
  margin: 0 4px;
  cursor: pointer;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #f8f8f8;
  transition: background 0.2s;
}
button:hover {
  background: #e0e0e0;
}
</style>